﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Detail.aspx.vb" Inherits="Final_Web_2._0_Site.Detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Button ID="Button1" runat="server" Text="Back" />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="CarID" DataSourceID="DetailSqlDataSource1">
        <Columns>
            <asp:TemplateField HeaderText="Picture">
           
           <ItemTemplate>
           <asp:HyperLink ID="Hyperlink1" NavigateUrl ='<%# Eval("CarID", "BigImageDetail.aspx?ID={0}") %>' runat ="server">
           <asp:Image ID="Image1" runat = "server" ImageUrl ='<%# Eval("CarPicture") %>' CssClass ="DetailImageSize " /> 

           </asp:HyperLink>
            </ItemTemplate>          
            
            </asp:TemplateField>

                    <asp:BoundField DataField="CarModelName" HeaderText="Car Model Name" 
                SortExpression="CarModelName" />
            <asp:BoundField DataField="CarModelYear" HeaderText="Car Model Year" 
                SortExpression="CarModelYear" />
            <asp:BoundField DataField="CC" HeaderText="CC" 
                SortExpression="CC" />
            <asp:BoundField DataField="CarColour" HeaderText="Car Colour" 
                SortExpression="CarColour" />
            <asp:HyperLinkField DataNavigateUrlFields="CarInfoURL" 
                DataNavigateUrlFormatString="{0}" DataTextField="CarModelName" 
                HeaderText="Info" />
        </Columns>
    </asp:GridView>





    <asp:SqlDataSource ID="DetailSqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Mercedes1ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:Mercedes1ConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [Car] WHERE ([CarID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CarID" QueryStringField="CarID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:Label ID="Label1" runat="server" Text="Please Comment below"></asp:Label>
    <br />
    <br />
    <asp:TextBox ID="txtcomment" runat="server" Height="66px" TextMode="MultiLine" 
        Width="368px"></asp:TextBox>
    <br />
    <br />
    <asp:Button ID="btncomment" runat="server" Text="Add" />
    <br />
    <br />
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="commentSqlDataSource1">
        <Columns>
            <asp:BoundField DataField="CommentBody" HeaderText="CommentBody" 
                SortExpression="CommentBody" />
            <asp:BoundField DataField="DateUploaded" HeaderText="DateUploaded" 
                SortExpression="DateUploaded" />
            <asp:BoundField DataField="TimeUploaded" HeaderText="TimeUploaded" 
                SortExpression="TimeUploaded" />
            <asp:BoundField DataField="UserName" HeaderText="UserName" 
                SortExpression="UserName" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="commentSqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MercedesConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:MercedesConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT Image_Comment.CommentBody, Image_Comment.DateUploaded, Image_Comment.TimeUploaded, aspnet_Users.UserName FROM Image_Comment, aspnet_Users WHERE (Image_Comment.ImageIDFK = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ImageIDFK" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    <br />
    <br />
    <br />
</asp:Content>
